<?php

/***  DOCUMENTATION LAYER

Ceo Framework Project Driver

Last Update: Sep 2007
Author: Tom at klenwell@gmail.com

SUMMARY
  Define basic project settings and call CEO framework driver.  Called directly 
  by web page or script.

NOTES
  $PROJECT['SERVER_HOST'] 
  This array is a security feature used to limit unauthorized remote
  access.  Each array entry should be a two-item array itself consisting of
  [0] release stage (alpha, beta, or final) and [1] the server name
  
  We use an array of arrays (rather than an assoc array) so that we can define
  multiple authorized server names for each release stage.
  
  $PROJECT['BASE_PATH']
  Note: this has been deprecated in favor of an auto-configuration method for
  the time being.
  
  This array can be used to define a directory path off the document root where
  this project is contained.  Defaults for all runtime URL paths are based off 
  of this.  It is keyed to the server host name.  If not defined for a server
  host, it will be empty and the project root will be the same as the document
  root.  
  
  $PROJECT['shutdown']
  We add the shutdown flag here as this file should be called by every script
  running the framework.

______________________________________________________________________________*/



// ** Project Settings (edit these)
/*____________________________________________________________________________*/

$PROJECT = array();

// Project Info
$PROJECT['id']          = 'demo';                   // this is used as a key in some arrays
$PROJECT['name']        = 'CEO Demonstration';      // name of project (for display purposes only)
$PROJECT['description'] = 'This is a sample project file for the CEO framework for PHP';
$PROJECT['keywords']    = 'php, mysql, framework, gpl';

// Release Hosts Array (release stage, server name) -- see notes above
$PROJECT['SERVER_HOST'][] = array('alpha', 'ceo');                // usu. a local development server
$PROJECT['SERVER_HOST'][] = array('alpha', 'test.ceo');           // alternate local server
$PROJECT['SERVER_HOST'][] = array('beta',  'beta.example.com');   // a restricted test server
$PROJECT['SERVER_HOST'][] = array('final', 'www.example.com');    // the production server

// Project Base Path (key to the release stage server name) -- see notes above
#$PROJECT['BASE_PATH']['ceo'] = '';

// Contact Info
$PROJECT['contact_email'] = 'EMAIL_ADDRESS_HERE';		// error messages will be sent here
$PROJECT['contact_name']  = 'admin';
$PROJECT['postmaster']    = 'ceo_mailer';
$PROJECT['reply_email']   = $PROJECT['contact_email'];

// To temporarily take the server offline
$PROJECT['shutdown'] = 0;
$sd_date = gmdate('h:ia');
$PROJECT['shutdown_message'] = <<<HTML

<h4>
server scheduled to be down between 

<!-- NOTE TIME FRAME HERE -->
<span style="color:red;">3:00 and 3:30 pm GMT</span>

</h4> 
<h5>(time is now $gm_date GMT)</h5>

HTML;

/*____________________________________________________________________________*/

	
	
// ** Load CEO Framework Driver (this should not need to be edited)
/*____________________________________________________________________________*/

// Ceo Super Array
$CEO = array();

$CEO['project_driver_path'] = __FILE__;
$CEO['project_root'] = dirname($CEO['project_driver_path']);
$CEO['start_uts'] = microtime();


// build CEO framework driver
$_s = DIRECTORY_SEPARATOR;
$CEO['DRIVER']['dir'] = 'php_ceo';                // ceo directory name
$CEO['DRIVER']['file'] = 'driver.inc.php';    // ceo driver file name
$CEO['DRIVER']['path'] = dirname($_SERVER['DOCUMENT_ROOT']) . "{$_s}{$CEO['DRIVER']['dir']}{$_s}{$CEO['DRIVER']['file']}";
		
// call driver
require_once($CEO['DRIVER']['path']);

// log load time
$_tx1 = ( !empty($_PAGE['tx1']) ) ? $_PAGE['tx1'] : $CEO['start_uts'];
$_tx2 = microtime();
$_load_tx = number_format((substr($_tx2,0,9))+(substr($_tx2,-10)) - (substr($_tx1,0,9)+substr($_tx1,-10)), 4);
$CEO['LOG'][] = "CEO project driver for project '{$PROJECT['name']}' loaded in $_load_tx s circa " . date('r') . ' T.U. (Tempus Unixis)';
    
/*____________________________________________________________________________*/

?>
